#include <iostream>
#include <string>
template <class T>
class TreeNode{
    T key;
    TreeNode<T>* LT;
    TreeNode<T>* RT;
    TreeNode(T value){
        key = value;
        LT = NULL;
        RT = NULL;
    } 
};
template <class T>
TreeNode<T> *create_post_in(T post[],T in[],int s1,int t1,int s2,int t2){
    int k;
    TreeNode *root;
    if (s1>t1) return NULL;
    root = new TreeNode<T>(post[t2]);
    for (k=s2; k<=t2; k++)
        if (in[k]==root->key) break;
    root->LT = create_post_in(post,in,s1,k-1,s2,k-1);
    root->RT = create_post_in(post,in,k,t1-1,k+1,t2);
    return root;
}

template <class T>
int main(){
    T post[],in[];
    TreeNode *root=create_post_in(post,in,s1,t1,s2,t2);
    return 0;
}